<?php 
include_once('connection/connection.php');
include('header.php');
include('menu.php');
include('config.php');

$frm=$_REQUEST['form_id'];
 	if(isset($_REQUEST['form_id'])){
	 $_SESSION['frm_unique_id']=$frm;
 	}
 	$frm =  $_SESSION['frm_unique_id'];
	
function getName($colName,$id)
{
	$sqlgetName="select distinct ".$colName."_name from tbl_lookup_location where ".$colName."_id=".$id;
	$querygetName=mysql_query($sqlgetName);
	$rowgetName=mysql_fetch_row($querygetName);
	return $rowgetName[0];
}

$qryMain="select * from tbl_dtls_q2_main where id='$frm'";
$resMain=mysql_query($qryMain);
$rowMain=mysql_fetch_array($resMain);
$dis=$rowMain['district_id'];
$blk=$rowMain['block_id'];
$dis_name=getName('district',$dis);
$_SESSION['dis_name']=$dis_name;
$tehsil=$rowMain['tehsil_id'];
$id1=$rowMain['id'];
$_SESSION['id1']=$id1;
?>
<script language="javascript" src="js/cal2.js">
/*
Xin's Popup calendar script-  Xin Yang (http://www.yxscripts.com/)
Script featured on/available at http://www.dynamicdrive.com/
This notice must stay intact for use
*/
</script>
<script language="javascript" src="js/cal_conf2.js"></script>
<!-- face file start -->
<script src="facefiles/jquery-1.2.2.pack.js" type="text/javascript"></script>
<link href="facefiles/facebox.css" media="screen" rel="stylesheet" type="text/css" />
<script src="facefiles/facebox.js" type="text/javascript"></script>

<script type="text/javascript">
    jQuery(document).ready(function($) {
      $('a[rel*=facebox]').facebox() 
    })
</script>
<!-- end face file -->
<script language="javascript" type="text/javascript">
function PrintContent()
{
	var DocumentContainer = document.getElementById('reportdiv');
	var WindowObject = window.open('PrintWindow','','width=900,height=760,scrollbars=1');
	WindowObject.document.writeln(DocumentContainer.innerHTML);
	WindowObject.document.close();
	WindowObject.focus();
	WindowObject.print();
	WindowObject.close();
	window.close();
}
</script>

<style type="text/css">
<!--
.heading_bgclr{
background-color:#999999;
}
.section_heading
{
	border:#666666 1px solid;
	width:780px;
	height:22px;
	color:#FFFFFF;
	font-family:arial;
	font-size:13px;
	font-weight:700;

}
.section_format
{
	background:#FFFFFF;
	width:780px;
}
.section_format table
{
	border-collapse:collapse;
	border-color:#666666;
	background-color:#EEEEEE;
	width:780px;
}
.section_format
{
	font-size:8.5pt;
	font-family:Verdana, Arial, Helvetica, sans-serif;
	color:#000000;
}
.section_format td
{
	height:25px;
}
-->
</style>

<script type="text/javascript" src="animatedcollapse.js"></script>

<script type="text/javascript">

animatedcollapse.addDiv('section1', 'fade=1,height=0px,persist=1,hide=0')
animatedcollapse.addDiv('section2', 'fade=1,height=0px,persist=1,hide=0')
animatedcollapse.addDiv('section3', 'fade=1,height=0px,persist=1,hide=0')
animatedcollapse.addDiv('section4', 'fade=1,height=0px,persist=1,hide=0')
animatedcollapse.addDiv('section5', 'fade=1,height=0px,persist=1,hide=0')
animatedcollapse.addDiv('section6', 'fade=1,height=0px,persist=1,hide=0')
animatedcollapse.addDiv('section7', 'fade=1,height=0px,persist=1,hide=0')
animatedcollapse.addDiv('section8', 'fade=1,height=0px,persist=1,hide=0')
animatedcollapse.addDiv('section9', 'fade=1,height=0px,persist=1,hide=0')
animatedcollapse.addDiv('section10', 'fade=1,height=0px,persist=1,hide=0')
animatedcollapse.addDiv('section11', 'fade=1,height=0px,persist=1,hide=0')
animatedcollapse.addDiv('section12', 'fade=1,height=0px,persist=1,hide=0')

animatedcollapse.ontoggle=function($, divobj, state){ //fires each time a DIV is expanded/contracted
	//$: Access to jQuery
	//divobj: DOM reference to DIV being expanded/ collapsed. Use "divobj.id" to get its ID
	//state: "block" or "none", depending on state
}

animatedcollapse.init()
</script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="css/speechbubbles.css" />

<script src="js/speechbubbles.js">

/***********************************************
* Speech Bubbles Tooltip- (c) Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

</script>


<script language=javascript>
jQuery(function($){ //on document.ready
 	//Apply tooltip to links with class="addspeech", plus look inside 'speechdata.txt' for the tooltip markups
	$('a.addspeech').speechbubble({url:'speechdata.txt'})
})

function display(val)
{
	//alert(val);
	//for(i=1; i<=total; i++)
	//{ 
		if(val == "NOT FUNCTIONAL")
		{
		//alert("if part");
			document.getElementById('showMydiv').style.display = "none";
			document.getElementById('hideMydiv').style.display = "block";
			/*
			document.getElementById('opration_status').disabled=true;	
			document.getElementById('quality_status').disabled=true;	
			document.getElementById('yield').disabled=true;
			document.getElementById('seasonal_flunctuation').disabled=true;
			document.getElementById('fluctuation_min').disabled=true;
			document.getElementById('fluctuation_max').disabled=true;
			*/
		}	
		else
		{
		//alert("else part");
			document.getElementById('showMydiv').style.display = "block";
			document.getElementById('hideMydiv').style.display = "none";
			/*
			var chks = document.getElementsByName('repairable_status');
			var hasChecked = false;
			for(var j=0; j<chks.length; j++)
			{
				if(chks[j].checked)
				{
					chks[j].checked=false;
				}
			}
			document.getElementById('remarks').value="";
			document.getElementById('nonFuncDiv').style.display = "none";
			document.getElementById('opration_status').disabled=false;	
			document.getElementById('quality_status').disabled=false;	
			document.getElementById('yield').disabled=false;
			document.getElementById('seasonal_flunctuation').disabled=false;
			document.getElementById('fluctuation_min').disabled=false;
			document.getElementById('fluctuation_max').disabled=false;
			*/
		}
}


</script>
<script language="javascript" type="text/javascript" src="js/jquery.js"></script>
<div id="reportdiv">
<div align="center" id="main_div">
<table border="0" width="786" id="main_table" align="center" style="padding:10px;">
<tr><td width="135" align="right"><a href="schemewiseListHP.php"><font face="Verdana" style="font-size: 8.5pt" color="#993333"><b>Back to Main</b></font></a></td>
  <td width="608" align="right"><input type="button" name="submit" value="Print" class="incmbutton" onClick="return PrintContent()" /></td>
  <td width="104" align="right"><?php echo '<a href="ListHPscheme.php?DT='.$dis.'&BC='.$blk.'"><font face="Verdana" style="font-size: 8.5pt" color="#993333"><b>Back</b></font></a>';?></td>
</tr>
<tr><td colspan="3" bgcolor="#C5D8EB"> 
   <a href="javascript:animatedcollapse.toggle('section1')">
   <div class="section_heading" style="color:#006699; padding-top:5px;">&nbsp;1. Scheme Details</div></a>
 </td> </tr>
  <tr><td colspan="3">
   <div id="section1" class="section_format">	
  <table border="1">
    <tr>
      <td colspan="2" align="right"><div style="float:right; padding-right:5px; border-left:1px solid #CCCCCC; width:35px"><a href="scheme_detail_edit_q2.php?var=<?php echo $frm;?>" rel="facebox" style="text-decoration:none"><img src="images/edit.gif" border="0" title="EDIT RECORD" /></a></div></td>
      </tr>
    <tr>
      <td width="400"><strong>&nbsp;Type of the Scheme (As of Now)</strong></td>
      <td width="400">&nbsp;<?php echo "$rowMain[type_scheme]";?></td>
      </tr>
    <tr>
      <td><strong>&nbsp;Name of the Scheme</strong></td>
      <td>&nbsp;<?php echo "$rowMain[scheme_name]";?></td>
      </tr>
    <tr>
      <td><strong>&nbsp;Year of Commissioning</strong></td>
      <td>&nbsp;<?php if($rowMain['year_comm']==0){echo "Not Provided";}else{echo "$rowMain[year_comm]";}?></td>
      </tr>
    <tr>
      <td><strong>&nbsp;Capital Cost (in <img src="images/26rup1.jpg" width="10"> Lakh)</strong></td>
      <td>&nbsp;<?php echo "$rowMain[capital_cost]";?></td>
      </tr>
	  <tr>
      <td><strong>&nbsp;Scheme Sanctioned Under</strong></td>
      <td>&nbsp;<?php echo "$rowMain[scheme_sanction]";?></td>
      </tr>
  </table>
  </div>   <!-- End of section1  -->
  <!-- Start of Inner Div  -->
 <!-- End of inner div-->
</td></tr>
<tr>
<td colspan="3" bgcolor="#C5D8EB">
  <a href="javascript:animatedcollapse.toggle('section2')">
  <div class="section_heading" style="color:#006699; padding-top:5px;">&nbsp;2. Location Details</div></a>  </td></tr>
  <tr><td colspan="3">
  <div id="section2"  class="section_format">	
  <table border="1">
    <tr>
      <td colspan="5">&nbsp;</td>
      </tr>
    <tr>
      <td width="292"><strong>&nbsp;District</strong></td>
      <td width="160">&nbsp;<?php $id="$rowMain[district_id]"; echo getName('district',$id);?></td>
      <td width="146"><strong>&nbsp;Block</strong></td>
      <td colspan="2">&nbsp;<?php $id="$rowMain[block_id]"; echo getName('block',$id);?></td>
    </tr>
    <tr>
      <td><strong>&nbsp;Gram Panchayat</strong></td>
      <td>&nbsp;<?php  $id="$rowMain[panchayat_id]"; echo wordwrap(getName('panchayat',$id), 20, "\n", true);?></td>
      <td><strong>&nbsp;Village Name</strong></td>
      <td colspan="2">&nbsp;<?php $id="$rowMain[village_id]"; echo wordwrap(getName('village',$id), 20, "\n", true);?></td>
    </tr>
    <tr>
      <td><strong>&nbsp;Census Village Code</strong></td>
      <td>&nbsp;<?php echo wordwrap($rowMain['census_vil_code'], 20, "\n", true);?></td>
      <td><strong>&nbsp;Referenece Id</strong></td>
      <td colspan="2">&nbsp;<?php echo "$rowMain[form_id]";?></td>
    </tr>
    <tr>
      <td><strong>&nbsp;Population Benefited (as per 2001 census)</strong></td>
      <td>&nbsp;<?php echo "$rowMain[population_benefited]";?></td>
      <td><strong>&nbsp;Present Population</strong></td>
      <td colspan="2">&nbsp;<?php echo "$rowMain[present_population]";?></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td colspan="2">&nbsp;</td>
    </tr>
    <tr style="background-color:#DADADA">
      <td colspan="5"><strong>&nbsp;Habitation (MH/OH) Covered</strong></td>
      </tr>
    <tr style="background-color:#CCCCCC">
      <td><strong>&nbsp;Name of Habitation</strong></td>
      <td style="padding-left:5px"><strong>Code No. (As per IMIS)</strong></td>
      <td><strong>&nbsp;Type MH/ OH</strong></td>
      <td width="72" style="padding-left:5px"><strong>No. of HP </strong></td>
      <td width="76" style="padding-left:5px"><strong>No. of SP </strong></td>
    </tr>
	<?php
				$qryHabit="select * from tbl_dtls_q2_habit where q2_id='$id1' order by habit_code asc";
				$resHabit=mysql_query($qryHabit);
				while($rowHabit=mysql_fetch_array($resHabit))
				{
				?>
    <tr>
      <td>&nbsp;<?php echo "$rowHabit[habit_name]";?></td>
      <td>&nbsp;<?php echo "$rowHabit[habit_code]";?></td>
      <td>&nbsp;<?php echo "$rowHabit[type_mh_oh]";?></td>
      <td>&nbsp;<?php echo "$rowHabit[hp_no]";?></td>
      <td>&nbsp;<?php echo "$rowHabit[sp_no]";?></td>
    </tr>
	<?php } ?>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td colspan="2">&nbsp;</td>
    </tr>
  </table>
  </div>  <!-- End of section2  -->
  </td></tr>
  <tr><td colspan="3" bgcolor="#C5D8EB"> 
   <a href="javascript:animatedcollapse.toggle('section3')">
   <div class="section_heading" style="color:#006699; padding-top:5px;">&nbsp;3. Engineering Aspects</div></a>
 </td> </tr>
  <tr><td colspan="3">
   <div id="section3" class="section_format">	
  <table border="1">
  <tr>
      <td colspan="2" align="right"><div style="float:right; padding-right:5px; border-left:1px solid #CCCCCC; width:35px"><a href="scheme_section3_q2.php?id=<?php echo $frm; ?>&val=<?php echo $rowMain['DP_population']; ?>&dis=<?php echo $dis; ?>" rel="facebox" style="text-decoration:none"><img src="images/edit.gif" border="0" title="EDIT RECORD" /></a></div></td>
      </tr>
    <tr style="background-color:#CCCCCC">
      <td colspan="2"> <strong>&nbsp;Design Parameters</strong></td>
      </tr>
    <tr>
      <td width="400"><strong>&nbsp;Population ( As per Design )</strong></td>
      <td width="400">&nbsp;<?php echo "$rowMain[DP_population]";?></td>
      </tr>
    <tr>
      <td><strong>&nbsp;Water Demand (As per Design ) in KLD</strong></td>
      <td>&nbsp;<?php echo "$rowMain[DP_water_demand]";?></td>
      </tr>
	  <tr>
      <td colspan="2">&nbsp;</td>
      </tr>
  </table>
  </div>   <!-- End of section3  -->
 </td></tr>
<tr><td colspan="3" bgcolor="#C5D8EB"> 
   <a href="javascript:animatedcollapse.toggle('section4')">
   <div class="section_heading" style="color:#006699; padding-top:5px;">&nbsp;4. Water Source Detail</div></a>
 </td> </tr>
  <tr><td colspan="3">
   <div id="section4" class="section_format">	
  <table border="1">
  <tr>
      <td colspan="13" align="right">
	  <div style="float:left; padding-right:5px; border-left:1px solid #CCCCCC; width:200px">
	 <!-- <a class="menu" href="q3_source_q2.php?id=<?php echo $frm ;?>&distId=<?php echo $rowMain[district_id];?>&blkId=<?php echo $rowMain[block_id];?>&panId=<?php echo $rowMain[panchayat_id];?>&cvcId=<?php echo $rowMain[census_vil_code];?>&villId=<?php echo $rowMain[village_id];?>" style="text-decoration:none;" onClick="window.open(this.href,'','width=1200,height=400,scrollbars=yes');return false" title="Survey Data">&nbsp;<b>Survey Data</b></a>	  </div>-->
	  <div style="float:right; padding-right:5px; border-left:1px solid #CCCCCC; width:35px"><a href="q2_hp.php?frm=<?php echo $frm;?>" rel="facebox" style="text-decoration:none"><img src="images/trash-can2-add.gif" border="0" title="ADD RECORD" /></a></div></td>
      </tr>
    <tr style="background-color:#DADADA">
      <td colspan="13"><strong>&nbsp;4. Water Source Details</strong></td>
      </tr>
    <tr style="background-color:#CCCCCC">
      <td width="99" rowspan="2" style="padding-left:5px"><strong>Habitation Name</strong></td>
      <td width="53" rowspan="2" style="padding-left:5px"><strong>Type of MH<br />
        OH</strong></td>
      <td width="5" rowspan="2" style="padding-left:5px"><strong>HP/SP</strong></td>
      <td width="83" rowspan="2" style="padding-left:5px"><strong>Location of HP</strong></td>
      <td width="98" rowspan="2" style="padding-left:5px"><strong>Functional Status</strong></td>
      <td width="112" rowspan="2" style="padding-left:5px"><strong>Operational status</strong></td>
      <td width="70" rowspan="2" style="padding-left:5px"><strong>Quality Status</strong></td>
      <td width="46" rowspan="2" style="padding-left:5px"><strong>Yield</strong></td>
      <td width="109" rowspan="2" style="padding-left:5px"><strong>Seasonal Fluctuation s in yield</strong></td>
      <td colspan="4" style="padding-left:5px"><strong>Water Table Fluctuations (m)</strong></td>
      </tr>
    <tr style="background-color:#CCCCCC">
      <td width="30"><strong>Min</strong></td>
      <td width="41"><strong>Max</strong></td>
      <td colspan="2">&nbsp;</td>
      </tr>
	<?php
		$qryHP="select * from tbl_dtls_q2_hp_status where q2_id='$frm' order by id";
		$resHP=mysql_query($qryHP);
		while($rowHP=mysql_fetch_array($resHP))
		{
		?>
    <tr>
      <td style="padding-left:5px"><a class="addspeech" href="#" style="text-decoration:none" title="<table width='360' border='1' style='border:1px solid #CCCCCC'>
	  <?php if($rowHP['para_hp']!="" || $rowHP['para_tds']!="" || $rowHP['para_cl']!="" || $rowHP['para_f']!="" || $rowHP['para_no3']!=""){?>
  <tr> 
    <td colspan='6' style='border:1px solid #CCCCCC'><font face='Verdana, Arial, Helvetica, sans-serif' style='font-size:10px' color='#000000'>Water Quality Parameter</font></td>
  </tr>
  <tr>
    <td width='52' align='center' style='border:1px solid #CCCCCC'><font face='Verdana, Arial, Helvetica, sans-serif' style='font-size:10px' color='#000000'>pH</font></td>
    <td width='73' align='center' style='border:1px solid #CCCCCC'><font face='Verdana, Arial, Helvetica, sans-serif' style='font-size:10px' color='#000000'>TDS(mg/l)</font></td>
    <td width='62' align='center' style='border:1px solid #CCCCCC'><font face='Verdana, Arial, Helvetica, sans-serif' style='font-size:10px' color='#000000'>Cl(mg/l)</font></td>
    <td width='60' align='center' style='border:1px solid #CCCCCC'><font face='Verdana, Arial, Helvetica, sans-serif' style='font-size:10px' color='#000000'>F(mg/l)</font></td>
    <td width='63' align='center' style='border:1px solid #CCCCCC'><font face='Verdana, Arial, Helvetica, sans-serif' style='font-size:10px' color='#000000'>NO<sub>3</sub>(mg/l)</font></td>
	<td width='73' align='center' style='border:1px solid #CCCCCC'><font face='Verdana, Arial, Helvetica, sans-serif' style='font-size:10px' color='#000000'>Testing Date</font></td>
  </tr>
  <tr>
    <td style='border:1px solid #CCCCCC' align='center'><font face='Verdana, Arial, Helvetica, sans-serif' style='font-size:10px' color='#000000'><?php echo "$rowHP[para_ph]";?></font></td>
    <td style='border:1px solid #CCCCCC' align='center'><font face='Verdana, Arial, Helvetica, sans-serif' style='font-size:10px' color='#000000'><?php echo "$rowHP[para_tds]";?></font></td>
    <td style='border:1px solid #CCCCCC' align='center'><font face='Verdana, Arial, Helvetica, sans-serif' style='font-size:10px' color='#000000'><?php echo "$rowHP[para_cl]";?></font></td>
    <td style='border:1px solid #CCCCCC' align='center'><font face='Verdana, Arial, Helvetica, sans-serif' style='font-size:10px' color='#000000'><?php echo "$rowHP[para_f]";?></font></td>
    <td style='border:1px solid #CCCCCC' align='center'><font face='Verdana, Arial, Helvetica, sans-serif' style='font-size:10px' color='#000000'><?php echo "$rowHP[para_no3]";?></font></td>
	<td style='border:1px solid #CCCCCC' align='center'><font face='Verdana, Arial, Helvetica, sans-serif' style='font-size:10px' color='#000000'><?php echo "$rowHP[para_testing_date]";?></font></td>
  </tr>
  <?php }else {?>
  <tr> 
    <td colspan='6' style='border:1px solid #CCCCCC'><font face='Verdana, Arial, Helvetica, sans-serif' style='font-size:10px' color='#FF0000'> &nbsp;Water quality parameter not inserted</font></td>
	<?php }?>
</table>
"><?php echo "$rowHP[habitation_name]";?></a></td>
      <td>&nbsp;<?php echo "$rowHP[type_mh_oh]";?></td>
      <td>&nbsp;<?php echo "$rowHP[hp_sp]";?></td>
      <td style="padding-left:5px"><?php echo "$rowHP[location]";?></td>
      <td style="padding-left:5px"><?php echo "$rowHP[functional_status]";?></td>
      <td>&nbsp;<?php echo "$rowHP[operational_status]";?></td>
      <td>&nbsp;<?php echo "$rowHP[quality_status]";?></td>
      <td>&nbsp;<?php echo "$rowHP[yield]";?></td>
      <td>&nbsp;<?php echo "$rowHP[seasonal_fluctuation]";?></td>
      <td>&nbsp;<?php echo "$rowHP[water_table_min]";?></td>
      <td>&nbsp;<?php echo "$rowHP[water_table_max]";?></td>
      <td width="12" align="center"><a href="edit_q2_hp.php?var=<?php echo $rowHP['id'];?>&loc=<?php echo $rowHP['q2_id'];?>" rel="facebox" style="text-decoration:none"><img src="images/edit.png" width="9" height="9" border="0" title="Edit individual record" /></a></td>
      <td width="9" align="center"><a href="delete_q2_hp.php?var=<?php echo $rowHP['id'];?>&loc=<?php echo $rowHP['q2_id'];?>&habit_code=<?php echo $rowHP['habit_code'];  ?>&code=<?php echo $rowHP['hp_sp']; ?>" rel="facebox" style="text-decoration:none"><img src="images/b_drop.png" width="9" height="9" border="0" title="Delete individual record" /></a></td>
    </tr>
	<?php }?>
    <tr>
      <td colspan="13">&nbsp;</td>
      </tr>
  </table>
  </div>   <!-- End of section4  -->
  
</td></tr>
<tr><td colspan="3" bgcolor="#C5D8EB"> 
   <a href="javascript:animatedcollapse.toggle('section5')">
   <div class="section_heading" style="color:#006699; padding-top:5px;">&nbsp;5. Operational Aspects</div></a>
 </td> </tr>
  <tr><td colspan="3">
   <div id="section5" class="section_format">	
  <table border="1">
    <tr>
      <td colspan="4" align="right"><div style="float:right; padding-right:5px; border-left:1px solid #CCCCCC; width:35px"><a href="q2_operational.php?frm=<?php echo $frm;?>" rel="facebox" style="text-decoration:none"><img src="images/edit.gif" border="0" title="EDIT RECORD" /></a></div></td>
      </tr>
    <tr>
      <td width="378"><strong>&nbsp;Current status of Scheme</strong></td>
      <td colspan="3">&nbsp;<?php echo "$rowMain[OA_current_status]";?></td>
      </tr>
    <tr>
      <td style="padding-left:5px"><strong>Operational Status (Number of months remaining operational)</strong></td>
      <td colspan="3">&nbsp;<?php echo "$rowMain[OA_operational_status]";?></td>
      </tr>
    <tr>
      <td style="background-color:#CCCCCC"><strong>&nbsp;Annual Operation &amp; Maintenance Cost </strong></td>
      <td width="127" style="background-color:#CCCCCC"><strong>&nbsp;FY 2009 - 10 </strong></td>
      <td width="124" style="background-color:#CCCCCC"><strong>&nbsp;FY 2008 - 09</strong></td>
      <td width="123" style="background-color:#CCCCCC"><strong>&nbsp;FY 2007 - 08</strong></td>
    </tr>
    <tr>
      <td><strong>&nbsp;Man Power Cost (In <img src="images/26rup1.jpg" width="10">&nbsp;Lakh)</strong></td>
      <td>&nbsp;<?php echo "$rowMain[manpower_cost_09_10]";?></td>
      <td>&nbsp;<?php echo "$rowMain[manpower_cost_08_09]";?></td>
      <td>&nbsp;<?php echo "$rowMain[manpower_cost_07_08]";?></td>
    </tr>
	  <tr>
      <td><strong>&nbsp;Material Cost - Repairs (In <img src="images/26rup1.jpg" width="10">&nbsp;Lakh)</strong></td>
      <td>&nbsp;<?php echo "$rowMain[material_cost_09_10]";?></td>
      <td>&nbsp;<?php echo "$rowMain[material_cost_08_09]";?></td>
      <td>&nbsp; <?php echo "$rowMain[material_cost_07_08]";?></td>
	  </tr>
	   <tr>
      <td><strong>&nbsp;Preventive Maintenance Mechanisms in Place</strong></td>
      <td colspan="3">&nbsp;<?php echo "$rowMain[maintenence_machanism]";?></td>
      </tr>
	   <tr>
	     <td colspan="4">&nbsp;</td>
	     </tr>
	   <tr>
	     <td colspan="4"><strong>&nbsp;Complaints Redressal Mechanism</strong></td>
	     </tr>
	   <tr>
	     <td><strong>&nbsp;1. Existing Reporting system </strong></td>
	     <td colspan="3">&nbsp;<?php echo "$rowMain[existing_reporting_system]";?></td>
	     </tr>
	   <tr>
	     <td><strong>&nbsp;2. Time Taken to address the complaint </strong></td>
	     <td colspan="3">&nbsp;<?php echo "$rowMain[time_taken]";?></td>
	     </tr>
	   <tr>
	     <td colspan="4">&nbsp;</td>
	     </tr>
	   <tr style="background-color:#CCCCCC;">
	     <td colspan="4"><strong>&nbsp;Constraint / Issues
			Faced by PHED officials</strong></td>
	     </tr>
	   <tr>
	     <td colspan="4">&nbsp;</td>
	     </tr>
	   <tr>
	     <td><strong>&nbsp;Institutional</strong></td>
	     <td colspan="3">&nbsp;<?php echo "$rowMain[constraint_institutional]";?></td>
	     </tr>
	   <tr>
	     <td><strong>&nbsp;Financial</strong></td>
	     <td colspan="3">&nbsp;<?php echo "$rowMain[constraint_financial]";?></td>
	     </tr>
	   <tr>
	     <td><strong>&nbsp;Operational</strong></td>
		 <?php  
		 $val=$rowMain['constraint_operational'];
		 $val=str_replace('Lack Vehicles for movement','Lack of Vehicles for movement',$val);
		 ?>
	     <td colspan="3">&nbsp;<?php echo "$val";?></td>
	     </tr>
	   <tr>
	     <td colspan="4">&nbsp;</td>
	     </tr>
  </table>
  </div>   <!-- End of section5  --> 
  
  
  </td></tr>
<tr><td colspan="3" bgcolor="#C5D8EB"> 
   <a href="javascript:animatedcollapse.toggle('section6')">
   <div class="section_heading" style="color:#006699; padding-top:5px;">&nbsp;6. Critical Habitation</div>
   </a>
 </td> </tr>
  <tr><td colspan="3"> 
   <div id="section6" class="section_format">	
  <table border="1">
    <tr >
      <td colspan="4">&nbsp;</td>
      </tr>
	  <tr style="background-color:#CCCCCC">
      <td width="99" style="padding-left:5px"><strong>Habitation Name</strong></td>
      <td width="100"><strong>&nbsp;Habitation Type</strong></td>
      <td colspan="2"><strong>&nbsp;Critical</strong></td>
	  </tr>
	  <?php
		$qryCritical="select * from tbl_dtls_q2_critical where q2_id='$frm' order by critical_hcode asc";
		$resCritical=mysql_query($qryCritical);
		$i=1;
		while($rowCritical=mysql_fetch_array($resCritical))
		{
		?>
    
    <tr> 
      <td style="padding-left:5px"><?php echo "$rowCritical[critical_hname]";?></td>
      <td>&nbsp;<?php echo "$rowCritical[type_habit]";?></td>
	  <td width="614"> &nbsp; <?php echo "$rowCritical[critical]";?> </td> 
	  <td width="14" align="center"><a href="critical_edit_view_q2.php?var=<?php echo $rowCritical['id'];?>" rel="facebox" style="text-decoration:none"><img src="images/edit.png" width="10" height="10" border="0" title="Edit individual record" /></a></td>
	 </tr> 
      <tr>
	  <?php
	if($rowCritical['critical']!="no")
	{
	?>
						<td>&nbsp;</td>
						<td>&nbsp;</td>
						<td>
							<table width="569" border="1" id="table16" style="width:600px;">
							<tr style="background-color:#CCCCCC">
								<td width="559"  >
								  <strong>&nbsp; 
								Critical Village in terms of quality </strong></td>
							</tr>
							<tr>
								<td>&nbsp;<?php echo "$rowCritical[CH_quality]";?></td>
							</tr>
							<tr style="background-color:#CCCCCC">
								<td><strong>&nbsp;
								Critical Village in terms of quantity </strong></td>
							</tr>
							<tr>
								<td>&nbsp;<?php echo "$rowCritical[CH_quantity]";?></td>
				    		</tr>
						</table>						</td>
						<td>&nbsp;</td>
			</tr>
	
    
	<?php }}?>
    <tr>
      <td colspan="4">&nbsp;</td>
      </tr>
  </table>
  </div>   <!-- End of section6 -->
</td></tr>
<tr><td colspan="3" bgcolor="#C5D8EB"> 
   <a href="javascript:animatedcollapse.toggle('section7')">
   <div class="section_heading" style="color:#006699; padding-top:5px;">&nbsp;7. Water Supply by Tankers</div>
   </a>
 </td> </tr>
  <tr><td colspan="3">
   <div id="section7" class="section_format">	
  <table border="1">
    <tr>
      <td colspan="8">&nbsp;</td>
      </tr>
	  <tr style="background-color:#CCCCCC">
      <td width="110"><strong>&nbsp;Habitation Name</strong></td>
      <td width="110"><strong>&nbsp;Habitation Type</strong></td>
      <td width="80"><strong>&nbsp;Tanker Nos.</strong></td>
      <td width="145"><strong>&nbsp;Total Quantity (KL)</strong></td>
      <td width="112"><strong>&nbsp;Area Covered</strong></td>
	   <td width="73"><strong>&nbsp;From(date)</strong></td>
	   <td width="77"><strong>&nbsp;To(date)</strong></td>
	   <td width="21">&nbsp;</td>
	  </tr>
	  <?php
						$qryTanker="select * from tbl_dtls_q2_tanker where q2_id='$frm' order by habitation_code asc";
						$resTanker=mysql_query($qryTanker);
						while($rowTanker=mysql_fetch_array($resTanker))
						{
					?>
    <tr>
      <td style="padding-left:5px"><?php echo "$rowTanker[habitation_name]";?></td>
      <td>&nbsp;<?php echo "$rowTanker[type_habit]";?></td>
      <td>&nbsp;<?php echo "$rowTanker[total_tanker_no]";?></td>
      <td>&nbsp;<?php echo "$rowTanker[water_quantity]";?></td>
      <td>&nbsp;<?php echo "$rowTanker[area_covered]";?></td>
	  <td>&nbsp;<?php echo "$rowTanker[from_date]";?></td>
	  <td>&nbsp;<?php echo "$rowTanker[to_date]";?></td>
	  <td align="center"><a href="tanker_supply_edit_q2.php?var=<?php echo $rowTanker['id'];?>" rel="facebox" style="text-decoration:none"><img src="images/edit.png" width="9" height="9" border="0" title="Edit individual record" /></a></td>
    </tr>
    <?php
	}?>
		  <tr>
      <td colspan="8">&nbsp;</td>
      </tr>
  </table>
  </div>   <!-- End of section7  -->
</td></tr>
</table>
</div>
</div>